import axios, {ResponseData} from 'yuxin-base/src/utils/axios'

/**
 * 添加账号
 * @param data
 */
export function addAccount(data: object): Promise<ResponseData> {
	return axios.request({
		url: 'saas-rental-device/device/platform/bind',
		data,
		method: 'POST'
	})
}

/**
 * 账号列表
 * @param params
 */
export function accountList(params: object): Promise<ResponseData> {
	return axios.request({
		url: 'saas-rental-device/device/platform/list',
		params,
		method: 'GET'
	})
}

/**
 * 更新账号
 * @param data
 */
export function updateAccount(id: string, data: object): Promise<ResponseData> {
	return axios.request({
		url: `saas-rental-device/device/platform/update/${id}`,
		data,
		method: 'PUT'
	})
}
/**
 * 解绑账号
 */
export function unbindAccount(id: string): Promise<ResponseData> {
	return axios.request({
		url: `saas-rental-device/device/platform/unbind/${id}`,
		method: 'DELETE'
	})
}
